<!DOCTYPE html>
<html lang="en">

<head>
	<meta charset="UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>shallowCopyTest</title>
	<script src="../../dist/Free.js"></script>
</head>

<body>
	<script>
		const obj = { x: 'abc', y: { m: 1, n: 2 } };
		const arr = [1, 2, 3, 4];

		// const result = shallowCopy(obj);
		const result = $.shallowCopy(obj);
		const result1 = $.shallowCopy(arr);
		// 修改新数据中某个引用类型的值
		result.y.m = 2;
		console.log(obj);
		console.log(result);
		console.log(obj === result);//false

		console.log(arr);
		console.log(result1);
		console.log(arr === result);//false
	</script>
</body>

</html>